package com.avo.ramcache.persist;

import com.avo.ramcache.persist.disruptor.DisruptorPersister;
import com.avo.ramcache.persist.queue.QueuePersister;
import com.avo.ramcache.persist.timing.TimingPersister;

public enum PersisterType {

    TIMING() {
        @Override
        public Persister createPersister() {
            return new TimingPersister();
        }
    },

    QUEUE() {
        @Override
        public Persister createPersister() {
            return new QueuePersister();
        }
    },

    RING_QUEUE() {
        @Override
        public Persister createPersister() {
            return new DisruptorPersister();
        }
    };

    PersisterType() {
    }

    public Persister createPersister() {
        throw new RuntimeException("persister is null.");
    }

}
